package avicit.bdp.dgs.mdm.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import avicit.platform6.core.properties.PlatformConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @金航数码科技有限责任公司
 * @作者：${tableInfo.classCreator}
 * @邮箱：${tableInfo.classMailbox}
 * @创建时间： 2023-12-06 11:02
 * @类说明：
 * @修改记录：
 */
@ApiModel(value = "MdataApplicationDTO", description = "应用表")
@Table(name = "bdp_dgs_mdata_application")
public class MdataApplicationDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @LogField
    @ApiModelProperty(value = "主键", name = "id")
    @FieldRemark(column = "id", field = "id", name = "主键")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    /**
     * 系统名称
     */
    @LogField
    @ApiModelProperty(value = "系统名称", name = "name")
    @FieldRemark(column = "name", field = "name", name = "系统名称")
    private String name;

    /**
     * 系统编码
     */
    @LogField
    @ApiModelProperty(value = "系统编码", name = "code")
    @FieldRemark(column = "code", field = "code", name = "系统编码")
    private String code;

    /**
     * 数据流向，1-数据流入，2-数据流出
     */
    @LogField
    @ApiModelProperty(value = "数据流向", name = "dataFlow")
    @FieldRemark(column = "data_flow", field = "dataFlow", name = "数据流向")
    private Integer dataFlow;

    /**
     * 授权码
     */
    @LogField
    @ApiModelProperty(value = "授权码", name = "authCode")
    @FieldRemark(column = "auth_code", field = "authCode", name = "授权码")
    private String authCode;

    /**
     * 服务路径
     */
    @LogField
    @ApiModelProperty(value = "服务路径", name = "servicePath")
    @FieldRemark(column = "service_path", field = "servicePath", name = "服务路径")
    private String servicePath;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述", name = "remark")
    @FieldRemark(column = "remark", field = "remark", name = "描述")
    private String remark;

    /**
     * 状态，1-启用，0-停用
     */
    @ApiModelProperty(value = "状态，1-启用，0-停用", name = "status")
    @FieldRemark(column = "status", field = "status", name = "状态")
    private Integer status;

    @Transient
    private String statusName;
    @Transient
    private String dataFlowName;
    @Transient
    private List<String> mdata;

    public List<String> getMdata() {
        return mdata;
    }

    public void setMdata(List<String> mdata) {
        this.mdata = mdata;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public String getDataFlowName() {
        return dataFlowName;
    }

    public void setDataFlowName(String dataFlowName) {
        this.dataFlowName = dataFlowName;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getDataFlow() {
        return dataFlow;
    }

    public void setDataFlow(Integer dataFlow) {
        this.dataFlow = dataFlow;
    }

    public String getServicePath() {
        return servicePath;
    }

    public void setServicePath(String servicePath) {
        this.servicePath = servicePath;
    }

    public String getAuthCode() {
        return authCode;
    }

    public void setAuthCode(String authCode) {
        this.authCode = authCode;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "bdp_dgs_mdata_application";
        } else {
            return super.logFormName;
        }
    }

    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "bdp_dgs_mdata_application";
        } else {
            return super.logTitle;
        }
    }

    public PlatformConstant.LogType getLogType() {
        if (super.logType == null) {
            return PlatformConstant.LogType.module_operate;
        } else {
            return super.logType;
        }
    }

}
